<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('查询抄送件')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li>
                            流水号：<input type="text" name="wsCode"/>
                        </li>
                        <li>
                            来电号码：<input type="text" name="fromTelA"/>
                        </li>
                        <li>
                            来电人：<input type="text" name="fromName"/>
                        </li>
                        <li>
                            来电内容：<input type="text" name="fmContent"/>
                        </li>
                        <li>
                            工单编号：<input type="text" name="workFormNo"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>


        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" class="table-striped"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">

    var prefix = ctx + "system/lookup";

    $(function () {
        var options = {
            url: prefix + "/mailCopyList",
            detailUrl: prefix+"/mailOrderDetail/{id}",
            sortName: "pkId",
            sortOrder: "desc",
            uniqueId: "pkId",
            modalName: "信件工单",
            fixedColumns:true,
            fixedNumber: 2,
            fixedRightNumber: 1,
            columns: [{
                checkbox: true
            },
                {field:'pkId',title:'pkId',visible: false},
                {field:'originFk',title:'mailId',visible: false},
                {field:'workFormNo',title:'工单编号',align:'left',halign:'center',sortable:true},
                {field:'spareString',title:'信件来源',align:'center',halign:'center',sortable:true, formatter:function(value,row,index) {
                        return value == '互联网+督查' ? '<span style="color:#ff0000;">'+value+'</span>' : value;
                    }},
                {field:'fromTopic',title:'主题',align:'left',halign:'center',sortable:true},
                {field:'fmAreaName',title:'属地',align:'left',halign:'center',sortable:true},
                {field:'fromName',title:'来电人',align:'center',sortable:true},
                {field:'fromTel',title:'来电号码',align:'center',sortable:true},
                {field:'dfmClaName',title:'诉求类别',align:'center',sortable:true},
                {field:'fromTime',title:'创建日期',align:'center',sortable:true},
                {field:'openX',title:'公开',align:'center',sortable:true,formatter:function(value,row,index){return fmtWFormOpen(value,row,index);}},
                {field:'wfLimit',title:'办理期限',align:'center',sortable: true},
                {field:'crtStepName',title:'当前流程',align:'left',halign:'center'},
                {field:'doverDesc',title:'终结件',align:'center',sortable:true},
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        console.log(row)
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-outline btn-xs " href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.pkId + '\')">查看</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });


    function fmtWFormSort(value,row,index){
        var rtn = value;
        var myVal = parseInt(value);
        switch (myVal) {
            case 11:
                rtn = '<div class="spLDark">普通</div>';
                break;
            case 21:
                rtn = '<div class="spOrange">督办</div>';
                break;
            case 31:
                rtn = '<div class="spRed">呈批</div>';
                break;
            default:
                break;
        }
        return rtn;
    }

    function fmtWFormOpen(value,row,index){
        var rtn = value;
        var myVal = parseInt(value);
        switch (myVal) {
            case 0:
                rtn = '<div class="spLDark">否</div>';
                break;
            case 1:
                rtn = '<div class="spRed">是</div>';
                break;
            default:
                break;
        }
        return rtn;
    }

</script>
</body>
</html>